import { defineStore } from "pinia";

export const useLocaleStore = defineStore("locale", {
  state: () => ({
    currentLang: localStorage.getItem("language") || "zh-cn",
  }),
  actions: {
    // 只更新状态和本地存储，不处理 Vue/i18n 逻辑
    setLang(lang) {
      this.currentLang = lang;
      localStorage.setItem("language", lang);
    },
  },
});
